package kkb.IOTest;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileOutputStreamTest {

    public static void main(String[] args) throws IOException {

        //会抛出异常  文件没有找到异常
        FileOutputStream outputStream = new FileOutputStream("D://fileoutputstream.txt");

        String out = "ABCDEFGHIJKLMN";
        //把字符串转成字节  写出
        byte[] write = out.getBytes();
        //写入数据
        outputStream.write(write);
        outputStream.close();

        System.out.println("已经写完");

    }
}
